<?php /* Smarty version 2.6.18, created on 2016-12-12 22:23:02
         compiled from attend/attend.list.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
                <div class="box-header with-border">
                    <span class="fa fa-table" style="float:left; font-size:18px; margin-top:2px; color:#3c8dbc;" ></span>
                    <p class="box-title">教师考勤表</p>
                    <a href="index.php?a=attend.in" class="btn btn-success btn-sm" style="float:right; color:#fff;">批量导入</a>
                    <a href="index.php?a=attend.outdata" target="_blank" class="btn btn-warning btn-sm" style="float:right; color:#fff; margin-right:8px;">导出数据</a>
                    <a href="index.php?a=attend.outtp" target="_blank" class="btn btn-warning btn-sm" style="float:right; color:#fff; margin-right:8px;">导出模板</a>
                </div>
				    <form name="myform" action="" method="get">
                    <div class="box-body">
                        <div class="col-md-3 col-xs-6 form-group">
                              <label class="col-sm-4 control-label text-right" style="padding:0; font-weight:500;">
                                   学年学期：
                              </label>
                              <div class="input-group col-md-8 col-xs-12">
							   <select class="form-control" id="semester_id" name="semester_id">
                                      <option value="">请选择</option>
									<?php $_from = $this->_tpl_vars['semester_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
									  <option value="<?php echo $this->_tpl_vars['key']; ?>
"<?php if ($this->_tpl_vars['key'] == $this->_tpl_vars['semester_id']): ?>selected<?php endif; ?>>
									  <?php echo $this->_tpl_vars['value']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
                                </select>
                              </div>						  
                        </div>
                        <div class="col-md-2 col-xs-6 form-group">
                              <label class="col-sm-5 control-label text-right" style="padding:0; font-weight:500;">
                                   学月：
                              </label>
                              <div class="input-group col-md-7 col-xs-12">
							   <select class="form-control" name="attend_smonth" id="semester_month">
                                      <option value="">请选择</option>
									<?php $_from = $this->_tpl_vars['month_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
									  <option value="<?php echo $this->_tpl_vars['key']; ?>
"<?php if ($this->_tpl_vars['key'] == $this->_tpl_vars['attend_smonth']): ?>selected<?php endif; ?>>
									  <?php echo $this->_tpl_vars['key']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
                                </select>
                              </div>						  
                        </div>
						 <input type="hidden" name="a" value="attend.list">
					     <button type="submit" class="btn btn-primary">查 询</button>
                        <div style="clear:both; height:2px;"></div>
                       </form>
                    
                    
                         <h4 class="text-center"><?php echo $this->_tpl_vars['semester_data']['semester_name']; ?>
第<?php echo $this->_tpl_vars['attend_smonth']; ?>
学月教师考勤表</h4>
                         <table class="table table-bordered" id="mytable">
                           <thead>						 
                                <tr>
                                     <td>编号</td>
                                     <td>教师姓名</td>
                                     <td>迟到</td>
                                     <td>早退</td>
									 <td>病假</td>
									 <td>事假</td>
									 <td>公假</td>
									 <td>婚假</td>
									 <td>产假</td>
                                     <td>丧假</td>
									 <td>旷工</td>
                                     <td>备注</td>
                                     <td>录入时间</td>
                                </tr>
							</thead>
							<tbody>
							<?php $_from = $this->_tpl_vars['attend_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                <tr>
                                     <td><?php echo $this->_tpl_vars['value']['staff_id']; ?>
</td>
                                     <td><?php echo $this->_tpl_vars['value']['staff_name']; ?>
</td>
                                     <td><?php echo $this->_tpl_vars['value']['attend_a']; ?>
</td>
                                     <td><?php echo $this->_tpl_vars['value']['attend_b']; ?>
</td>
                                     <td><?php echo $this->_tpl_vars['value']['attend_c']; ?>
</td>
                                     <td><?php echo $this->_tpl_vars['value']['attend_d']; ?>
</td>
									 <td><?php echo $this->_tpl_vars['value']['attend_e']; ?>
</td>
									 <td><?php echo $this->_tpl_vars['value']['attend_f']; ?>
</td>
									 <td><?php echo $this->_tpl_vars['value']['attend_g']; ?>
</td>
									 <td><?php echo $this->_tpl_vars['value']['attend_h']; ?>
</td>
									 <td><?php echo $this->_tpl_vars['value']['attend_i']; ?>
</td>
									 <td><?php echo $this->_tpl_vars['value']['attend_content']; ?>
</td>
                                     <td><?php echo $this->_tpl_vars['value']['create_time']; ?>
</td>
                                 </tr>
							<?php endforeach; endif; unset($_from); ?>
						   </tbody>
                         </table> 
						 <?php echo $this->_tpl_vars['page']; ?>

				    </div><!--box-body -->

             </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
 <!--      二级联动     -->
<script type="text/javascript">
        $(document).ready(function () {
            $("#semester_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=semester.monthjson",
			type:"get",
			data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
					//实例2个字符串变量来拼接下拉列表
					var industr = "";
					//使用jquery解析json中的数据
					$.each(msg, function (n, value) {
						industr += ("<option value=\"" + value.semester_month + "\">" + value.semester_month);
						industr += ("</option>");
					});

					$("#semester_month").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>
